import { METHOD, PATH } from './config'
import { request } from './core'

const APIClient = {
    install(Vue) {
        Vue.prototype.$API = this;
    },
    getSwiper() {
        return request(METHOD.GET, PATH.GETSWIPER)
    },
    getList() {
        return request(METHOD.GET, PATH.GETLIST)
    },
    getdetail() {
        return request(METHOD.GET, PATH.GETDETAIL)
    },
    articledetail(id) {
        return request(METHOD.GET, PATH.ARTICLEDETAIL, { params: { id: id } })
    },

    //登录接口
    getlogin(params) {
        return request(METHOD.GET, PATH.GETLOGIN, { params })
    },

    //注册接口
    getregister(params) {
        return request(METHOD.POST, PATH.GETREGISTER, { params })
    },

    //手机号注册接口
    getregister(params) {
        return request(METHOD.POST, PATH.GETPHONE, { params})
    },
    
    //商品详情接口
    getshopdetail(id) {
        return request(METHOD.GET, PATH.GETSHOPDETAIL,{params:{id:id}})
    },

    //商品分类接口
    getclassify() {
        return request(METHOD.POST, PATH.GETCLASSIFY)
    },
}

export default APIClient